package 设计模式.命令模式;

import lombok.Data;

import java.io.Serializable;

/**
 * 调用者类，例如命令调用者
 */
@Data
public class CommandInvoker implements Serializable {
    private Command command;

    public CommandInvoker(Command command) {
        this.command = command;
    }

    public void setCommand(Command command) {
        this.command = command;
    }

    public void executeCommand() {
        command.execute();
    }
}
